﻿#region Using directives

using System;
using System.Collections;
using System.Data;
using UFSoft.UBF.UI.MD.Runtime;
using UFSoft.UBF.UI.MD.Runtime.Implement;
using UFIDA.U9.UI.PDHelper;
using UFIDA.U9.Cust.SH.SHFastShipBP.Proxy;
using UFIDA.U9.Cust.SH.SHFastShipBP;

#endregion

namespace SHFastShipUI
{	public partial class SHFastShipUIModel 
	{
        //初始化UIMODEL之后的方法
        public override  void AfterInitModel()
        {
            this.SHFastShip.FieldOrg.DefaultValue = PDContext.Current.OrgRef.ID;
            this.SHFastShip.FieldOrg_Code.DefaultValue = PDContext.Current.OrgRef.CodeColumn;
            this.SHFastShip.FieldOrg_Name.DefaultValue = PDContext.Current.OrgRef.NameColumn;

            this.SHFastShip.FieldDocDate.DefaultValue = DateTime.Now;

            //销售业务类型默认=购货
            this.SHFastShip.FieldSaleType.DefaultValue = 1001107237192321;
            this.SHFastShip.FieldSaleType_Code.DefaultValue = "购货";
            this.SHFastShip.FieldSaleType_Name.DefaultValue = "购货";

            //单据类型
            GetDefaultDocTypeProxy proxy=new GetDefaultDocTypeProxy();
            EntityDTOData dto=proxy.Do();
            this.SHFastShip.FieldDocType.DefaultValue = dto.ID;
            this.SHFastShip.FieldDocType_Code.DefaultValue = dto.Code;
            this.SHFastShip.FieldDocType_Name.DefaultValue = dto.Name;
            this.SHFastShip.FieldShipDocTypeParam.DefaultValue = "ShipDocType";
            

        }
        
        //UIModel提交保存之前的校验操作.
        public override void OnValidate()
        {
        		base.OnValidate() ;
            OnValidate_DefualtImpl();
            //your coustom code ...
        }
	}
}